package oracle;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
import java.sql.Statement;

public class oracleJDBC作业1 {
    public static void main(String[] args) throws ClassNotFoundException, SQLException {
        Class.forName("oracle.jdbc.OracleDriver");
        String username="system";
        String password="tfk111";
        String url="jdbc:oracle:thin@127.0.0.1:1521:XE";
        Connection con=DriverManager.getConnection(url,username,password);
        String sql="delete from login where id=1";
        String sql1="update login set name='每当想起你时' where id=2";
        String sql2="insert into login value(1,'哈哈',15613124418)";
        Statement st=con.createStatement();
        int rows=st.executeUpdate(sql);
        System.out.println("修改成功的条数"+rows);
    }
}
